<?php
/**
 * @version 1.0 $Id: event.php 662 2008-05-09 22:28:53Z schlu $
 * @package Joomla
 * @subpackage EventList
 * @copyright (C) 2005 - 2008 Christoph Lukes
 * @license GNU/GPL, see LICENSE.php
 * EventList is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License 2
 * as published by the Free Software Foundation.

 * EventList is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with EventList; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */

// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die();

/**
 * Renders an Event element
 *
 * @package Joomla
 * @subpackage EventList
 * @since 0.9
 */

class JElementTimepicker extends JElement
{

 /**
    * Element name
    * @access    protected
    * @var        string 
    */
    var    $_name = 'Calendar';
 
    function fetchElement($name, $value = '', $attribs = '')
    {
       if (is_array($attribs)) {
            $attribs = JArrayHelper::toString( $attribs );
        }
        global $mainframe;
        $url = $mainframe->isAdmin() ? $mainframe->getSiteURL() : JURI::base();
        $document =& JFactory::getDocument();
        $document->addScript($url.'administrator/components/com_eventlist/assets/js/timepicker.js');
 
        return '<input type="text" id="'.$name.'" name="'.$name.'" value="'.htmlspecialchars($value, ENT_COMPAT, 'UTF-8').'" size=8 maxlength=8 onblur="validateDatePicker(this)" '.$attribs.' />'.
                 '<img class="calendar" src="'.JURI::root(true).'/administrator/components/com_eventlist/assets/images/timepicker/timepicker.gif" alt="time selector" id="'.$name.'_img" onclick="selectTime(this,\''.$name.'\')" style="cursor:hand" />';
    }
}
?>